/* 用户中心页面样式 */

/* 通用重置和基础样式 */
* {
    box-sizing: border-box;
}

/* 头部导航栏用户区域样式 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.user-dropdown-button:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.user-dropdown-content {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 160px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.user-dropdown.open .user-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #4b5563;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: #f3f4f6;
}

.user-dropdown-item:last-child {
    border-top: 1px solid #e5e7eb;
}

/* 主内容区域样式 */
#personal-info, #user-management {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 用户管理表格样式 */
#user-management table {
    width: 100%;
    border-collapse: collapse;
}

#user-management th,
#user-management td {
    padding: 0.75rem 1rem;
    text-align: left;
}

#user-management th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #6b7280;
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

#user-management td {
    border-top: 1px solid #e5e7eb;
    vertical-align: middle;
}

#user-management tr {
    transition: background-color 0.2s ease;
}

#user-management tr:hover {
    background-color: #f9fafb;
}

/* 表格操作按钮样式优化 */
.edit-user-button,
.delete-user-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.edit-user-button:hover,
.delete-user-button:hover {
    transform: translateY(-1px);
}

/* 模态框样式 */
#user-modal {
    backdrop-filter: blur(2px);
}

#user-modal.open {
    opacity: 1;
}

#user-modal.open #user-modal-content {
    transform: scale(1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .user-dropdown-content {
        right: 50%;
        transform: translateX(50%) translateY(-8px);
    }
    
    .user-dropdown.open .user-dropdown-content {
        transform: translateX(50%) translateY(0);
    }
    
    #personal-info .grid,
    #user-management .grid {
        grid-template-columns: 1fr;
    }
    
    #user-management table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        min-width: 640px;
    }
    
    #personal-info,
    #user-management {
        padding: 4px;
    }
    
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* 中屏幕设备优化 */
@media (max-width: 1024px) {
    .max-w-4xl {
        max-width: 90%;
    }
}

/* 加载动画 */
.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 按钮样式 */
.btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: #9ca3af;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #6b7280;
}

/* 输入框样式 */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 表单分组样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #374151;
}

/* 消息提示样式 */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 0.25rem;
    padding: 0.25rem 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 可访问性样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
button:focus,
input:focus,
select:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 禁用状态样式 */
button:disabled,
input:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}